package edu.zhoujw.project.infra.event.impl;

import edu.zhoujw.project.infra.event.BaseDomainEvent;
import edu.zhoujw.project.infra.event.DomainEventPublisher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * @author zhoujw
 * @time 2021/12/3 13:33
 * @description
 */
@Slf4j
@Component
public class DomainEventPublisherImpl implements DomainEventPublisher {

    @Autowired
    private ApplicationEventPublisher applicationEventPublisher;

    @Override
    public void publishEvent(BaseDomainEvent event) {
        applicationEventPublisher.publishEvent(event);
    }
}
